{% extends "GairalAdminBundle::layout.html.twig" %}

{% block bodyAdmin %}
<section id="educationAdmin" class="content">
    <div class="row-fluid">
        <table class="table table-striped table-condensed">
            <caption>
                <h4>Education</h4>
            </caption>
            <thead>
                <tr>
                    <th>Image</th>
                    <th>Name</th>
                    <th>Diploma</th>
                    <th>Skills</th>
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td colspan="5">
                        <div class="btn-toolbar text-center">
                            <a href="{{ path('AdminEducationAdd')}}" class="btn btn-large btn-primary">
                                Add new Education
                                <i class="icon-white icon-plus"></i>
                            </a>
                        </div>
                    </td>
                </tr>
    {% for education in listEducation %}
                <tr>
                    <td>
        {% if education.image %}
                            <img src="{{ asset(education.image.webPath) }}" alt="education->name"/>
        {% endif %}
                        </td>
                        <td>{{ education.name }}</td>
                        <td>
                    {% if education.diploma %}
                                <span>{{ education.diploma }}</span>
        {% endif %}
                            </td>
                            <td>
                    {% if education.skills|length > 0 %}
                                <div class="btn-group">
                                    <a class="btn  btn-info dropdown-toggle" data-toggle="dropdown" href="#">
                                        Skills
                                        <span class="caret"></span>
                                    </a>
                                    <ul class="dropdown-menu">
                    {% for skill in education.skills %}
                                            <li><a tabindex="-1" href="#">{{ skill.name }}</a></li>
                    {% endfor %}
                                            </ul>
                                        </div>
                    {% endif %}
                                </td>
                            <td>
                                <div class="btn-toolbar">
                                    <a href="{{ path('AdminEducationModify', {'id': education.id})}}" data-toggle="modal" class="btn btn-small btn-inverse">
                                        Edit
                                        <i class="icon-white icon-edit"></i>
                                    </a>
                                    <a href="#remove_{{education.id}}" data-toggle="modal" class="btn btn-small btn-danger">
                                        Remove
                                        <i class="icon-white icon-trash"></i>
                                    </a>
                                </div>

                                <div class="modal hide" id="remove_{{education.id}}">
                                    <div class="modal-header"> <a class="close" data-dismiss="modal">×</a>
                                        <h3>Remove Education</h3>
                                    </div>
                                    <div class="modal-body alert">
                                        <p>
                                            Are you sure to want to remove the Education: "{{ education.name }}" ?
                                        </p>
                                    </div>
                                    <div class="modal-footer">
                                        <a href="{{ path('AdminEducation') }}" class="btn btn-info" data-dismiss="modal">
                                            Cancel
                                        </a>
                                        <a href="{{ path('AdminEducationRemove', {'id': education.id})}}" class="btn btn-danger">
                                            Remove
                                            <i class="icon-white icon-trash"></i>
                                        </a>
                                    </div>
                                </div>
                            </td>
                        </tr>
    {% else %}
                        no education
    {% endfor %}
                    </tbody>
                </table>
            </div>
        </section>
{% endblock %}